<template>
	<div class="wrap">
    <wrap-head :userName.sync='userName'></wrap-head>
    <router-view></router-view>
		<!-- <div class="contentBox"> -->

      <!-- <wrap-slide :isChangeBigWidth.sync='isChangeBigWidth'></wrap-slide> -->
      

				
			
			<!-- <div class="content" :class="classToggle">
			</div> -->
		<!-- </div> -->
	</div>
</template>

<script>
import WrapHead from '@/components/employee/header';
import WrapSlide from '@/components/router-component/homepage2/aside';
import WrapNull from '@/components/public/leftNavNull';
//	import {vueEle} from '@/common/js/vueBus.js'

import router from '@/router/index';
export default {
  data() {
    return {
      userName:'',
      data1: null,
      menuData: null,
      browserHeight: null,
      isChangeBigWidth: false,
      isShowLeft: false,
      menuDataTest: [],
      defaultActiveTest: '',
      menu: null,
      defaultOpenMenuTest: []
    };
  },
  components: {
    WrapHead,
    WrapSlide,
    WrapNull
  },
  computed: {
    classToggle: function() {
      return {
        isBig: this.isChangeBigWidth,
        isSmall: !this.isChangeBigWidth
      };
    }
  },
  methods: {
    
    iterateMenu: function(data) {
      if (data[0].childList && data[0].childList.length > 0) {
        this.menu = this.menu + '-' + data[0].id;
        this.iterateMenu(this.data[0]);
      } else {
        this.menu = this.menu + '-' + data[0].id;
        return data[0];
      }
    }
  },
  // created() {
  //   var self = this;
  //   //获取侧边菜单栏数据
  //   // this.Axios.Post(this.URL.getDeptparentBylist.url)
  //   // .then(function(res){

      
  //   this.Axios.Post(this.URL.leaderPortal.url, {
  //     type: 1
  //   }).then(res => {
  //     var result = res.data.datas.userHrMenuList;

  //     var target = this.$route.query.target;

  //     if (!target) {
  //       if (!result) {
  //         console.log(result, 'result');
  //         return '';
  //       }
  //       console.log(result, 'result');
  //       if (result.length > 0) {
  //         if (result[1].childList && result[1].childList.length > 0) {
  //           this.menu = result[1].id;

  //           var node = this.iterateMenu(result[1].childList);
  //           if (node.menuUrl.indexOf('?') > -1) {
  //             var url = node.menuUrl + '&target=' + this.menu;
  //           } else {
  //             var url = node.menuUrl + '?target=' + this.menu;
  //           }
  //           console.log(this.menu, 'this.menu');
  //           this.$router.push(url);

  //           this.defaultActiveTest = this.menu;
  //         } else {
  //           this.$router.push(result[1].menuUrl + '?target=' + result[1].id);

  //           this.defaultActiveTest = result[1].id + '';
  //         }
  //       }
  //     } else {
  //       this.menu = target;
  //       this.defaultActiveTest = target;
  //     }

  //     if (!this.menu || this.menu.indexOf('-') === -1) {
  //     } else {
  //       var menuList = this.menu.split('-');
  //       var result = [];

  //       for (var i = menuList.length; i > 0; i--) {
  //         menuList.splice(i - 1, 1);
  //         if (menuList.length > 0) {
  //           result.push(menuList.join('-'));
  //         }
  //       }
  //       this.defaultOpenMenuTest = result;
  //     }

  //     self.menuDataTest = res.data.datas.userHrMenuList;

  //     this.isShowLeft = true;
  //   });
  // },
  beforeMount() {
    var self = this;
  },
  mounted() {
    this.userName = localStorage.getItem('userName')
    this.browserHeight =
      Math.max(
        document.body['scrollHeight'],
        document.documentElement['scrollHeight']
      ) - 50;
  }
};
</script>

<style scoped>
/*section左侧部分样式*/

.wrap {
  margin: 0 auto;
  background-color: #ecf0f5;
  padding: 0 120px;
  margin-top: 50px;

}
.contentBox {
  position: relative;
  min-height: -moz-calc(100%);
  min-height: -ms-calc(100%);
  min-height: -webkit-calc(100%);
  min-height: calc(100%);
}
/*.sidebar .fa {
		margin-right: 5px;
	}
	.sidebar .fa-circle{
		font-size: 12px;
	}
	.sidebar .topTitle {
		background-color: #eee;
		height: 56px;
		line-height: 56px;
		padding: 0 10px;
	}
	.sidebar .settings {
		color: #858885;
	}
	
	.sidebar .settings div {
		margin-bottom: 10px;
	}*/

.content {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #ecf0f5;
  min-height: 100%;
  background-origin: padding-box;
  padding-top: 50px;
  width: 80%;

}
.contentBox .isSmall {
  /* left: 230px; */
  left: 0;
  transition: left 0.4s ease-in-out;
}
.contentBox .isBig {
  /* left: 50px; */
  left: 0;
  transition: left 0.4s ease-in-out;
}
.content > div {
  padding: 15px;
}
</style>
<style>
.contentBox .el-loading-mask {
  background-color: rgba(16, 16, 16, 0.5);
}
</style>
